<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" href="index.css" type="text/css" />
    <link rel="shortcut icon" href="img/ship/ship2.png" type="image/png" />
  	<link rel="alternate" title="RSS - Chat" href="rss.php" type="application/rss+xml" />
  	<link rel="alternate" title="RSS - Score" href="rss.php?score=true" type="application/rss+xml" />
		<title>AYASS - Another Yet Another Space Shooter</title>
  	<script src="ship.js"></script>
  	<script src="image.js"></script>
  	<script src="alien.js"></script>
  	<script src="alien_dummy.js"></script>
  	<script src="alien_mummy.js"></script>
  	<script src="alien_follower.js"></script>
  	<script src="alien_fummy.js"></script>
  	<script src="alien_shrapnel.js"></script>
  	<script src="alien_turret.js"></script>
  	<script src="alien_missile.js"></script>
  	<script src="alien_cannon.js"></script>
  	<script src="alien_rock.js"></script>
  	<script src="alien_stealer.js"></script>
  	<script src="alien_launcher.js"></script>
  	<script src="shot.js"></script>
  	<script src="credit.js"></script>
  	<script src="index.js"></script>
  	<script src="button.js"></script>
	</head>
	<body onload="onLoad()" onkeydown="onKeyDown(event)" onkeyup="onKeyUp(event)" onkeypress="" onbegindrag="return false" onselectstart="return false">

    <div class="header">
      <img class="logo" src="img/ayass.png" width="48" height="48" />
      <div class="version">v0.27</div>
      <div class="code"><a href="http://code.google.com/p/ayass">code</a></div>
      <div class="game">Another Yet Another Space Shooter</div>
      <div class="inspire">a game inspired by <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3654">CVE-2010-3654</a></div>
    </div>

    <noscript>
      <div>
      You need to <b>enable JavaScript</b> to fully enjoy this game!
      </div>
    </noscript>

    <!-- div style="color: white;">
      <button style="min-width: 16px; height: 16px; border: 2px white; background: rgba(200,200,255,0.5) url('button_range.png') no-repeat; cursor: pointer; padding: 0px; border-radius: 3px; color: white; font-weight: bold;" onclick="ship.range+=20" title="Range"></button>
      1x
    </div -->

		<canvas id="canvas" width="640" height="480" onmousemove="canvasMouseMove(this,event)" onmousedown="canvasMouseDown(this,event)" onmouseup="canvasMouseUp(this,event)">
		Your browser does not support HTML 5 Canvas. Try one of the following browsers: Google Chrome 7, Firefox 4, Opera 10.63 or any other modern browser that supports web standards.
		</canvas> 
    <fieldset>
      <legend>How to play</legend>
      Use <b>w,a,s,d</b> keys for moving your ship. 
      Aim at aliens with <b>mouse cursor</b> and fire at them with <b>left mouse button</b>. 
      If you have <b>enough credit</b>, you can buy ship <b>upgrades</b> by pressing keys <b>1 ~ 9</b> or by clicking on upgrade button.
      If you die, press <b>F5</b> for restart. 
      Press <b>p</b> to pause the game.
      Game is also paused when you are inside text input fields.
      Your goal is to <b>destroy all aliens</b>.
      Good luck!
      
      <!-- more help -->
      <a style="float: right; text-decoration: none; color: green;" href="#" onclick="if (document.getElementById('help2').style.display=='block') document.getElementById('help2').style.display='none'; else document.getElementById('help2').style.display='block';">...read more</a>
      <div id="help2" style="display: none;">
      <hr />

      <p>
      <img class="help" src="img/dummy/dummy0.png" /> Dummy is basic alien type. It usually moves only horizontally or vertically. It is easy to kill and when it explodes, it doesn't produce any dangerous shrapnels.
      </p>

      <p>
      <img class="help" src="img/mummy/mummy0.png" /> Mummy is mother of all dummies. It is slightly bigger, move the same way as dummies and what is the worst, it can summon other dummies. It is also quite hard to kill.  
      </p>      

      <p>
      <img class="help" src="img/follower/follower0.png" /> Follower is one persistent mother f*cker. It will follows you anywhere and when you kill it, it even explode with burst of schrapnels that may harm you or even kill you. 
      </p>      

      <p>
      <img class="help" src="img/fummy/fummy0.png" /> Fummy is mother of all followers. It summon them like there is no tomorrow. It moves the same way as Mummy - horizontally and vertically, is equally hard to kill and you should kill it as soon as possible. Otherwise the army of sumonned followers will kill you.   
      </p>      

      <p>
      <img class="help" src="img/turret/turret0.png" /> Turret is static alien. It fires shrapnels to random direction. Try to avoid it or kill it from long distance because when this guy is gone, it produce shrapnels too.   
      </p>      

      <p>
      <img class="help" src="img/cannon/cannon0.png" /> Cannon is like turret, except it has enough inteligence to aim at your ship and fire directly on it. When destroyed, shrapnels are produced too.  
      </p>      

      <p>
      <img class="help" src="img/launcher/launcher0.png" /> Launcher is real beast. It aims just as good as cannon, but it fires guided missile. Once guided is fired, you have only seconds to live. The good news is that missile (unlike shrapnel) can be destroyed while it approaching you. Be careful tho. 
      </p>      

      <p>
      <img class="help" src="img/rock/rock0.png" /> Rock is small chunk of asteroid. It is attracted to earth gravity, and will eventually burn in earth atmosphere. You can destroy it but it produce even more space junk.  
      </p>      

      <p>
      <img class="help" src="img/stealer/stealer0.png" /> Stealer is harmless enemy, but it steals dropped credits, and even when you kill it, it returns back only half of them so you should kill it first, otherwise you are loosing credits.  
      </p>      

      <p>
      <img class="help" src="img/ship/ship3.png" /> This is your ship. Our last hope. You are the only one that stands between earth and alien invasion. You have to save our world!
      </p>
         
      </div>
    </fieldset>

		<div id="chat">
		  <span>Name </span><input id="name" size="8" onfocus="in_input=true;pause=true;" onblur="in_input=false;pause=false;"/>
      <span>Message </span><input id="message" onfocus="in_input=true;pause=true;" onblur="in_input=false;pause=false;" onkeypress="if (event.keyCode==13) send(true)" size="50" maxlength="1200" />
		  <a title="Send message" onclick="send(true)">&#9993;</a>
		  <a title="Refresh chat" onclick="send(false)">&#8634;</a>
    </div>

		<div id="board">
		<a href="chat.php">Comments...</a>
		</div>

<!--
Todo:

New alien types:
- alien_boss - bigger mother ship (e.g. 64x64) that is very hard to kill, is shooting at me all the time and rapidly produce all kinds of aliens   

Consider:
- try drawing background in canvas and compare speed with current bg drawing (css offset)
- multiple paralax background (big stars are closer, moving 1x speed, small stars are far away moving at 0.5 speed)
- do not use magnet while i am firing unless i buy some "multitask device upgrade" so otherwise I have to stop firing to collect credits
- let cannon overheat when I fire too much + another upgrade to cool it down faster so i can fire more
- upgrades as a drop from aliens, e.g. +1 distance, so I need to catch it to get it
- to have earth blue arrow some meaning and to not let player move too far away from earth, maybe it should cause slow permanent damage to ship when I move too far from earth
- show green arrow only when that alien is too far so i cannot see it (this need to point green arrow to nearest wich might be costy)
-->

  </body>
</html>
